import React,{useState} from 'react'

function Bulbs(){
    const [on,setOn] = useState(false);
    const lightOn = () => setOn(true)
    const lightOff = () => setOn(false)
    return(
        <>
            <div className={on?'bulb-on':'bulb-off'}/>
            <button onClick={lightOn}>开</button>
            <button onClick={lightOff}>关</button>
        </>
    );
}
